#pragma once

#include "tstring.h"
#include <windows.h>

#include <boost/gil/gil_all.hpp>
using namespace boost::gil;

typedef enum { imtJPEG, imtPNG, imtGIF, imtBMP, imtUnknown } ImageType_t;

class CImageIOHelper
{
	ImageType_t m_InputImageType;
	ImageType_t m_OutputImageType;
	int m_JPEGQuality;

	void SaveJPEG(const tstring& FileName, const rgb8_image_t& Image);
	void SavePNG(const tstring& FileName, const rgb8_image_t& Image);
	void SaveGIF(const tstring& FileName, const rgb8_image_t& Image);
	void SaveBMP(const tstring& FileName, const rgb8_image_t& Image);
public:
	CImageIOHelper();

	void LoadImage(const tstring& FileName, rgb8_image_t* Image);

	ImageType_t GetInputImageType();
	void SetOutputImageType(ImageType_t ImageType);
	void SetJPEGQuality(int Quality);
	
	void SaveImage(const tstring& FileName, const rgb8_image_t& Image);
};